package ch18.v3.controller;

import ch18.v3.model.Student;
import ch18.v3.service.StudentManagerService;
import ch18.v3.service.StudentManagerServiceImpl;

import java.util.List;

public class StudentManagerController {


    public StudentManagerService managerService;

    public StudentManagerController() {
        managerService = new StudentManagerServiceImpl();
    }

    // 添加学生信息
    public void addStu(Student student) {
        managerService.add(student);
    }

    // 删除学生信息
    public void deleteStu(String stuNo) {
        managerService.delete(stuNo);
    }

    // 修改学生信息
    public void updateStu(Student student) {

        managerService.update(student);
    }

    // 查询学生列表信息
    public List<Student> queryStuList() {
        List<Student> students = managerService.queryLists();
        return students;
    }

    // 查询单一学生信息
    public Student queryStu(String stuNo) {
       Student student = managerService.query(stuNo);
       return student;
    }
}


